<?php
/**
 * LG
 */
namespace Home\Controller;
use Think\Controller;
class IntroduceController extends Controller{
    public function Introduce(){
        $username = cookie('username');
        $this->assign('username',$username);

        $get = I('get.id');
        $pro = M('Pro');
        $rs = $pro->join('imooc_cate on imooc_cate.id=imooc_pro.cId')->where('imooc_pro.id="'.$get.'"')->select();
        $cName = $rs[0]['cName'];
        $cId = $rs[0]['cId'];
        $this->assign('cName',$cName);
        $pImg = $rs[0]['pImg'];
        $this->assign('pImg',$pImg);
        $pName = $rs[0]['pName'];
        $this->assign('pName',$pName);
        $iPrice = $rs[0]['iPrice'];
        $this->assign('iPrice',$iPrice);

        $sj = $pro->where('cId="'.$cId.'"')->order('rand()')->select();
        $this->assign('sj',$sj);
        $this->display();
    }
}
?>